﻿@using SmartStore.Admin.Models.DataExchange
@model ExportProfileModel
@{
	Layout = null;
}
<div>
	@if(Model.AvailableProviders.Count > 0)
	{
		<form method="POST" class="export-profile-form" action="@Url.Action("Create", "Export")">
			<table class="adminContent">
				<tr class="wide">
					<td class="adminTitle">
						@Html.SmartLabelFor(model => model.ProviderSystemName)
					</td>
					<td class="adminData">
						<select name="@Html.FieldNameFor(x => x.ProviderSystemName)" id="@Html.FieldIdFor(x => x.ProviderSystemName)" class="form-control form-control-lg select-customtemplate drop-customtemplate">
							@foreach (var item in Model.AvailableProviders.OrderBy(x => x.FriendlyName))
							{
								<option value="@item.SystemName" data-id="@item.Id" data-imageurl="@item.ImageUrl">@item.FriendlyName</option>
							}
						</select>
					</td>
				</tr>
				@if(Model.AvailableProfiles.Count > 0)
				{
					<tr class="wide">
						<td class="adminTitle">
							@Html.SmartLabelFor(model => model.CloneProfileId)
						</td>
						<td class="adminData">
							<select name="@Html.FieldNameFor(x => x.CloneProfileId)" id="@Html.FieldIdFor(x => x.CloneProfileId)" class="form-control form-control-lg select-customtemplate drop-customtemplate" 
									data-placeholder="@Model.UnspecifiedString">
								<option></option>
								@foreach (var item in Model.AvailableProfiles.OrderBy(x => x.FriendlyName))
								{
									<option value="@item.Id" data-systemname="@item.SystemName" data-imageurl="@item.ImageUrl">@item.FriendlyName</option>
								}
							</select>
						</td>
					</tr>
				}
				<tr class="wide">
					<td class="adminData" colspan="2">
						@foreach (var item in Model.AvailableProviders)
						{
							if (item.Description.HasValue())
							{
								<div id="ExportProviderDescription@(item.Id)" class="export-provider-description text-muted">@item.Description</div>
							}
						}
					</td>
				</tr>
			</table>
		</form>
	}
	else
	{
		@T("Admin.DataExchange.Export.NoExportProvider")
	}
</div>